package com.atguigu.gmall.payment.service;

import com.atguigu.gmall.model.order.OrderInfo;
import com.atguigu.gmall.model.payment.PaymentInfo;

import java.util.Map;

/**
 * @author atguigu-mqx
 */
public interface PaymentService {

    //  保存交易记录 , 写只有一种支付宝。
    void savePaymentInfo(OrderInfo orderInfo, String paymentType);

    /**
     *
     * @param outTradeNo
     * @param paymentType
     * @return
     */
    PaymentInfo getPaymentInfo(String outTradeNo, String paymentType);

    /**
     *
     * @param outTradeNo
     * @param paymentType
     * @param paramsMap
     */
    void paySuccess(String outTradeNo, String paymentType, Map<String, String> paramsMap);

    /**
     * 更新数据
     * @param outTradeNo
     * @param paymentType
     * @param paymentInfo
     */
    void updatePaymentInfo(String outTradeNo, String paymentType, PaymentInfo paymentInfo);

    /**
     * 关闭交易记录
     * @param orderId
     */
    void closePayment(Long orderId);

}
